package com.lyandwc.lw_bbs.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.sql.Timestamp;

@Data
@TableName("notification")
public class Notification {
    @JSONField()
    Integer id;
    @JSONField(ordinal = 1)
    int action;
    @JSONField(ordinal = 2)
    int received;
    @JSONField(ordinal = 3, format="yyyy-MM-dd HH:mm:ss")
    Timestamp createAt;

    @JSONField(ordinal = 4)
    Integer commentId;
    @JSONField(ordinal = 5)
    Integer userId;
    @JSONField(ordinal = 6)
    Integer fromCommentId;
    @JSONField(ordinal = 7)
    Integer fromUserId;

    @JSONField(ordinal = 8)
    @TableField(exist = false)
    Comment comment;
    @JSONField(ordinal = 9)
    @TableField(exist = false)
    Comment fromComment;
    @JSONField(ordinal = 10)
    @TableField(exist = false)
    User fromUser;
}
